// vits.config.ts
import {
	defineConfig
} from "vite"
import uni from "@dcloudio/vite-plugin-uni"
import {
	resolve
} from "path"
import AutoImport from 'unplugin-auto-import/vite'

export default defineConfig({
	resolve: {
		alias: {
			"@": resolve(__dirname, "src"),
		},
		extensions: ['.mjs', '.js', '.jsx', '.json', '.vue'],
	},
	plugins: [
		uni(),
		// ---- 配置自动引入 ----
		AutoImport({
			include: [
				/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
				/\.vue$/,
				/\.vue\?vue/, // .vue
				/\.md$/, // .md
			],
			imports: ['vue', 'uni-app'],
			dts: 'typings/auto-imports.d.ts',
		})
	],
})